<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: content-box;
        }

        .loader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .bg {
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: #000;
            animation: animate 6s ease-in-out infinite;
        }

        h2 {
            color: #fff;
            z-index: 1;
            font-size: 6em;
            font-weight: 800;
        }

        @keyframes animate {
            0% {
                transform: scaleX(0);
                transform-origin: left;
                background-color: #ff2c60;
            }

            25% {
                transform: scaleX(1);
                transform-origin: left;
            }

            25.0001% {
                transform: scaleX(1);
                transform-origin: right;
                background-color: #ff2c60;
            }

            50% {
                transform: scaleX(0);
                transform-origin: right;
                background-color: #ff2c60;
            }

            50.0001% {
                background-color: #03a9f4;
            }

            75% {
                transform: scaleX(1);
                transform-origin: right;
                background-color: #03a9f4;
            }

            75.0001% {
                transform: scaleX(1);
                transform-origin: left;
                background-color: #03a9f4;
            }

            100% {
                transform: scaleX(0);
                transform-origin: left;
            }
        }
    </style>
</head>

<body>
    <div class="loader">
        <div class="bg"></div>
        <h2>Loading...</h2>
    </div>
</body>

</html>